package Translation;

import Socker.UDPServer;

import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Map;

/**
 * @Title: Server
 * @Author 郑雨杭
 * @Package Translation
 * @Date 2024/7/10 21:16
 * @description:
 */
public class Server extends UDPServer {
    Map<String,String> map = new HashMap<>();
    public Server(int port) throws SocketException {
        super(port);
        map.put("dog","狗");
        map.put("cat","猫");
        map.put("fuck","卧槽");

    }

    @Override
    protected String process(String s) {
        String ret = map.get(s);
        if(ret==null) {
            return "找不到";
        }
        return ret;
    }

    public static void main(String[] args) throws IOException {
        new Server(9090).start();
    }
}
